﻿/**	lolix_type.h
 *	----	Create Time Stamp	--2007-03-06 20:55:33--
 *------------------------------------------------------------------------------
 *	Mean	:lolix 使用的简单的类型定义
 *	Author	:Nick Shallery	(nicknide@gmail.com)
 *	Version	:1.0.53.75	(2009-11-15 14:32:17)
 *------------------------------------------------------------------------------
**/	/*YOU HAVE ALL LEFT WITH THIS CODE WHILE YOU KEEP COMMENT IN EVERY COPY.*/

#if			!defined(__LOLIX__LOLIX_TYPE__K_IN_G__)
#define		__LOLIX__LOLIX_TYPE__K_IN_G__
//==============================================================================
//--------------------------------------------------------------------------
#if			!defined(__LOLIX__LOLI_X_CFG__K_IN_G__)
	#include	"./lolix_cfg.h"
#endif	//	!defined(__LOLIX__LOLI_X_CFG__K_IN_G__)


#if			!defined(__LOLIX__LOLIX_ERR__K_IN_G__)
	#include	"./lolix_err.h"
#endif	//	!defined(__LOLIX__LOLIX_ERR__K_IN_G__)

#if			!defined(__LOLIX__LOLI_X_MACRO__K_IN_G__)
	#include	"./lolix_macro.h"
#endif	//	!defined(__LOLIX__LOLI_X_MACRO__K_IN_G__)

#if			!defined(__LOLIX__TOY__REBIND_TYPE__K_IN_G__)
	#include	"./toy/rebind_type.hpp"
#endif	//	!defined(__LOLIX__TOY__REBIND_TYPE__K_IN_G__)



#include	<cstddef>
#if			LOLIX_CFG__LINK_TO_CLIB
#include	<memory>
#endif	//	LOLIX_CFG__LINK_TO_CLIB


namespace lolix{
	enum LOLIX_RETNV;
	//typedef	unsigned int	LOLIX_RETNV;		//	lolix return number value
	struct LOLIX_ITF_ID{
		unsigned int	r, g, b, a;
		LOLIX_INLINE_CALL bool operator == (const LOLIX_ITF_ID& o)const
			{
			return r == o.r && g == o.g && b == o.b && a == o.a;
			}
		LOLIX_INLINE_CALL bool operator != (const LOLIX_ITF_ID& o)const
			{
			return !((*this) == o);
			}
		LOLIX_INLINE_CALL bool operator < (const LOLIX_ITF_ID& o)const
			{
			if ( a > o.a )	return false;	if ( a < o.a )	return true;
			if ( b > o.b )	return false;	if ( b < o.b )	return true;
			if ( g > o.g )	return false;	if ( g < o.g )	return true;
			if ( r > o.r )	return false;	if ( r < o.r )	return true;
							return false;
			}

		LOLIX_INLINE_CALL bool operator > (const LOLIX_ITF_ID& o)const
			{
			return (!operator ==(o)) && (!operator<(o));
			}

		LOLIX_INLINE_CALL LOLIX_ITF_ID& operator = (const LOLIX_ITF_ID& o)
			{
			r = o.r; g = o.g; b = o.b; a = o.a;
			return *this;
			}
		LOLIX_INLINE_CALL LOLIX_ITF_ID(unsigned __int32 ir, unsigned __int32 ig, unsigned __int32 ib, unsigned __int32 ia)
			: r(ir), g(ig), b(ib), a(ia)
			{
			}
		LOLIX_INLINE_CALL LOLIX_ITF_ID(const LOLIX_ITF_ID& o)
			: r(o.r), g(o.g), b(o.b), a(o.a)
			{
			}
		LOLIX_INLINE_CALL LOLIX_ITF_ID(void)
			{
			}
		LOLIX_INLINE_CALL ~LOLIX_ITF_ID(void)
			{
			}

		template<typename _Ty>
		static	LOLIX_INLINE_CALL	const LOLIX_ITF_ID	__get_by_type_ptr(_Ty*)
			{
			return LOLIX_ITF_ID(_Ty::_lx_itf_id_r, _Ty::_lx_itf_id_g, _Ty::_lx_itf_id_b, _Ty::_lx_itf_id_a);
			}

		class	compare_type;
	};	//	lolix type id

	class	LOLIX_ITF_ID::compare_type
	{
	public:
		typedef LOLIX_ITF_ID	first_argument_type;
		typedef LOLIX_ITF_ID	second_argument_type;
		typedef bool			result_type;

		bool operator ()(const LOLIX_ITF_ID& l, const LOLIX_ITF_ID& r)const
		{
#define		LOLIX_TMP_OPERATOR_CMP(v)	if ( l.v < r.v ) return true;if ( l.v > r.v ) return false
			LOLIX_TMP_OPERATOR_CMP(r);
			LOLIX_TMP_OPERATOR_CMP(g);
			LOLIX_TMP_OPERATOR_CMP(b);
			LOLIX_TMP_OPERATOR_CMP(a);
#undef		LOLIX_TMP_OPERATOR_CMP
			return false;
		}
	};

#if			LOLIX_CFG__USE_CLASS_ALLOC
	#define	OWNER_CLASS_ALLOC(self_name)	LOLIX_ALLOC(#self_name, THIS_ALLOC);

#else	//	LOLIX_CFG__USE_CLASS_ALLOC
	#define	OWNER_CLASS_ALLOC(self_name)

#endif	//	LOLIX_CFG__USE_CLASS_ALLOC

	#define	LOLIX_DECLARE_ITF(self_name, base_name, id)		\
		private:\
			typedef	self_name this_type;\
			typedef base_name base_type;\
			friend	::lolix::_help::__query_itf;\
		public:\
			LOLIX_DEFINE_ITF_ID id

	#define	LOLIX_DEFINE_ITF_WITH_ALC_USE_SELF_QUERY(self_name, base_name, id, get_alc, use_self_query)	\
	public:\
		virtual	::lolix::LOLIX_RETNV	LOLIX_CALL	query_itf(itf** out_ptr, ::lolix::LOLIX_ITF_ID const* in_id)\
		{return ::lolix::_help::__query_itf::do_query(this, out_ptr, in_id, ::lolix::type::type_choise<use_self_query, ::lolix::type_true, ::lolix::type_false>::type());}\
		LOLIX_DEFINE_ITF_WITH_ALC_WITHOUT_QUERY(self_name, base_name, id, get_alc)

	#define	LOLIX_DEFINE_ITF_WITH_ALC(self_name, base_name, id, get_alc)	LOLIX_DEFINE_ITF_WITH_ALC_USE_SELF_QUERY(self_name, base_name, id, get_alc, false)

	#define	LOLIX_DEFINE_ITF_WITH_ALC_WITHOUT_QUERY(self_name, base_name, id, get_alc)	\
private:\
	LOLIX_DECLARE_ITF(self_name, base_name, id);\
	virtual	::lolix::size_type LOLIX_CALL	LOLIX_DEF__INC_RELEASE_ITF_WITH_ALC_PROC(get_alc);\
	OWNER_CLASS_ALLOC(self_name);\
	typedef	THIS_ALLOC<this_type>	allocator_type;\
	friend	allocator_type;\
	lolix::ref_counter*	_ref;\
	LOLIX_DEF__CANNT_COPY_LOLI


	#define		LOLIX_DEFINE_ITF(self_name, base_name, id)	LOLIX_DEFINE_ITF_WITH_ALC(self_name, base_name, id, _alc)
	#define		LOLIX_DEFINE_ITF_ID(r, g, b, a)			const static unsigned __int32	_lx_itf_id_r = (r), _lx_itf_id_g = (g), _lx_itf_id_b = (b), _lx_itf_id_a = (a);typedef	char __lx_itf_id_rgbx[GB(1)]
	#define		LOLIX_ITF_ID_FROM(id_ptr, type)			__LOLIX__BEGIN_MACRO() (id_ptr)->r = type::_lx_itf_id_r; (id_ptr)->g = type::_lx_itf_id_g, (id_ptr)->b = type::_lx_itf_id_b, (id_ptr)->a = type::_lx_itf_id_a; __LOLIX__END_MACRO()
	#define		LOLIX_ITF_FROM_TYPE(type)				::lolix::LOLIX_ITF_ID::__get_by_type_ptr<type>(0)
	#define		LOLIX_ITF_FROM_VAL(val)					LOLIX_ITF_FROM_TYPE(REBIND_TYPE(val))
	#define		LOLIX_ITF_ID_EQUL_WITH_TYPE(id, type)	( (id)->r == type::_lx_itf_id_r && (id)->g == type::_lx_itf_id_g && (id)->b == type::_lx_itf_id_b && (id)->a == type::_lx_itf_id_a )


#if			defined(LOLIX_DEF__CC_TYPE_MS)
	typedef	size_t		size_type;
	typedef	ptrdiff_t	difference_type;
	typedef	ptrdiff_t	ptrdiff_type;
#else	//	defined(LOLIX_DEF__CC_TYPE_MS)
	typedef	toy::size_info<size_t(~0)>::size_type		size_type;
	typedef	toy::size_info<size_t(~0)>::difference_type	difference_type;
#endif	//	defined(LOLIX_DEF__CC_TYPE_MS)

#define	__LOLIX_TMP_DEFINE__DEF_TYPE__(bits_cnt)	typedef	signed	__int##bits_cnt	lx_i##bits_cnt; typedef	unsigned __int##bits_cnt	lx_u##bits_cnt
	__LOLIX_TMP_DEFINE__DEF_TYPE__(8);	//	lx_i8, lx_u8
	__LOLIX_TMP_DEFINE__DEF_TYPE__(16);	//	lx_i16, lx_u16
	__LOLIX_TMP_DEFINE__DEF_TYPE__(32);	//	lx_i32, lx_u32
	__LOLIX_TMP_DEFINE__DEF_TYPE__(64);	//	lx_i64, lx_u64
#undef	__LOLIX_TMP_DEFINE__DEF_TYPE__

	typedef	float	lx_f32;
	typedef	double	lx_f64;

	class	type_true{};
	class	type_false{};

	class LOLIX_NO_VTABLE lolix_inst;

	namespace type{
		#pragma	region	//	u_type define
		template<typename _Tl, typename _Tr>
		union u_type
		{
		private:
			template<typename gcc_only, bool>
			struct cp
			{
				static void copy(u_type<_Tl, _Tr> o){ first = o.first; }
			};
			template <typename gcc_only>
			struct cp<gcc_only, false>
			{
				static void copy(u_type<_Tl, _Tr> o){ second = o.second; }
			};
		public:
			typedef _Tl	first_type;
			typedef	_Tr	second_type;

			LOLIX_INLINE_CALL explicit u_type<_Tl,_Tr>(const _Tl& lt):first(lt){}
			LOLIX_INLINE_CALL explicit u_type<_Tl,_Tr>(const _Tr& rt):second(rt){}

			LOLIX_INLINE_CALL u_type(void){}
			LOLIX_INLINE_CALL u_type<_Tl,_Tr> operator = (u_type<_Tl,_Tr> o){ cp<void, (sizeof first >sizeof second)>::copy(o); return *this;}

			first_type	first;
			second_type	second;
		};

		template<typename _Ty>
		union u_type<_Ty, _Ty>
		{
		public:
			typedef _Ty	first_type;
			typedef _Ty	second_type;

			LOLIX_INLINE_CALL explicit u_type<_Ty,_Ty>(_Ty lt):first(lt){}
			LOLIX_INLINE_CALL u_type(void){}
			LOLIX_INLINE_CALL u_type<_Ty,_Ty> operator = (u_type<_Ty,_Ty> o){ first = o.first; return *this;}
			union
			{
				_Ty	first;
				_Ty	second;
			};
		};
		#pragma	endregion
		#pragma region	//	type_choise	define
		template<bool, typename L, typename R>
		class type_choise
		{
		public:
			typedef L type;
		};

		template<typename L, typename R>
		class type_choise<false, L, R>
		{
		public:
			typedef R type;
		};
		#pragma endregion
		#pragma region	//	type_equal define
		template<typename L, typename R>
		class type_equal
		{
		public:
			enum {value = 0};
		};

		template<typename T>
		class type_equal<T, T>
		{
		public:
			enum {value = 1};
		};
		#pragma endregion
		#pragma region	//	pass_type define
		////////////////////////////////////////////////////////////////////////////
		template<typename _Type>
		class pass_type
		{
		public:
			//typedef typename type_choise<(sizeof(_Type) <= sizeof(void*)), _Type, _Type& >::base_type value_type;
			typedef typename type_choise<(sizeof(_Type) <= sizeof(void*)), const _Type, const _Type& >::type const_value_type;
		};

		template<typename _Type>
		class pass_type<_Type&>
		{
		public:
			typedef _Type& value_type;
			typedef const _Type& const_value_type;
		};
		template<typename _Type>
		class pass_type<const _Type>
		{
		public:
			typedef typename type_choise<(sizeof(_Type) <= sizeof(void*)), const _Type, const _Type& >::type value_type;
			typedef typename type_choise<(sizeof(_Type) <= sizeof(void*)), const _Type, const _Type& >::type const_value_type;
		};
		template<typename _Type>
		class pass_type<const _Type&>
		{
		public:
			typedef const _Type& value_type;
			typedef const _Type& const_value_type;
		};
		template<>
		class pass_type<float>
		{
		public:
			typedef	const float	const_value_type;
		};
		template<>
		class pass_type<double>
		{
		public:
			typedef	const double const_value_type;
		};
		template<>
		class pass_type<long double>
		{
		public:
			typedef	const long double const_value_type;
		};
		#pragma endregion
		///////////////////////////////////////////////////////////////////////////////
		template<typename _T>
		struct type_unref
			{
			typedef _T value_type;
			};
		template<typename _T>
		struct type_unref<_T&>
			{
			typedef typename type_unref<_T>::value_type value_type;
			};

		template<typename _T>
		struct type_unconst
			{
			typedef _T value_type;
			};
		template<typename _T>
		struct type_unconst<const _T>
			{
			typedef _T value_type;
			};

		template<typename _T>struct type_def
			{
			typedef typename type_unconst<typename type_unref<_T>::value_type>::value_type value_type;
			typedef const value_type const_value_type;
			typedef value_type& reference;
			typedef const value_type& const_reference;
			typedef value_type*	pointer;
			typedef value_type*	const_pointer;
			};
	}

	using type::u_type;
	class itf;
	namespace _help
	{
		struct	__query_itf
		{
			template<typename _Ty>
			static LOLIX_INLINE_CALL LOLIX_RETNV do_query(_Ty* ptr, itf** out_ptr, const LOLIX_ITF_ID* in_id)
			{
				return do_query(ptr, out_ptr, in_id, type_false());
			}

			template<typename _Ty>
			static LOLIX_INLINE_CALL LOLIX_RETNV do_query(_Ty* ptr, itf** out_ptr, const LOLIX_ITF_ID* in_id, lolix::type_false)
			{
				if ( !LOLIX_ITF_ID_EQUL_WITH_TYPE(in_id, _Ty) )
					return do_query((_Ty::base_type*)ptr, out_ptr, in_id, lolix::type_false());

				(*out_ptr = (_Ty::base_type*)ptr)->inc_ref();
				return LOLIX_RETNV_OK;
			}

			template<typename _Ty>
			static LOLIX_INLINE_CALL LOLIX_RETNV do_query(_Ty* ptr, itf** out_ptr, const LOLIX_ITF_ID* in_id, lolix::type_true)
			{
				LOLIX_RETNV rtv;
				if ( !LOLIX_IS_ERROR(rtv = ptr->__Query_itf(out_ptr, in_id)) )
					return rtv;

				if ( !LOLIX_ITF_ID_EQUL_WITH_TYPE(in_id, _Ty) )
					return do_query((_Ty::base_type*)ptr, out_ptr, in_id, lolix::type_false());

				(*out_ptr = (_Ty::base_type*)ptr)->inc_ref();
				return LOLIX_RETNV_OK;
			}

			static LOLIX_INLINE_CALL LOLIX_RETNV do_query(itf* /*ptr*/, itf** /*out_ptr*/, const LOLIX_ITF_ID* /*in_id*/, lolix::type_true)
			{
				return LOLIX_ERROR_INVALID_TYPE;
			}

			static LOLIX_INLINE_CALL LOLIX_RETNV do_query(itf* /*ptr*/, itf** /*out_ptr*/, const LOLIX_ITF_ID* /*in_id*/, lolix::type_false)
			{
				return LOLIX_ERROR_INVALID_TYPE;
			}
		};
	}


	//	关于工厂的说明: 凡是通过工厂中 create 出来的对象必须是已经被内部设置为标准引用
	//	因此外部可以直接 release, 而不需要额外的 inc_ref 过程调用
	//	希望所有工厂的建立者遵守这个基本约定
	class LOLIX_NO_VTABLE itf
	{
	public:
		LOLIX_DECLARE_ITF(itf, void, (0xF931B317, 0xC80946f6, 0xBD59E46A, 0x58FE1120));
		typedef	lolix::size_type		size_type;
		typedef	lolix::difference_type	difference_type;
		typedef	lolix::ptrdiff_type		ptrdiff_type;
		typedef	lolix::LOLIX_RETNV		LOLIX_RETNV;
		typedef	lolix::LOLIX_ITF_ID		LOLIX_ITF_ID;

		//	size_type 返回当前操作之后还有多少个引用计数, 返回 0 则表示该对象已经被释放了
		//	但是不管是不是被释放了, 一旦 release 之后则不应该继续使用这个对象
		//		不要以为 release 之后立即 inc_ref 可以抢救回来这个对象哟( ^_^ )
		LOLIX_INTERFACE(inc_ref		, size_type		, (void)const);
		LOLIX_INTERFACE(release		, size_type		, (void)const);
		LOLIX_INTERFACE(itf_id		, void			, (LOLIX_ITF_ID*)const);
		LOLIX_INTERFACE(query_itf	, LOLIX_RETNV	, (itf**, const LOLIX_ITF_ID*));

		#pragma	region	//	query_itf 重载
		template<typename _Ty>
		LOLIX_INLINE_CALL	LOLIX_RETNV	query_itf(_Ty& out_ptr)
			{
			const LOLIX_ITF_ID id(LOLIX_ITF_FROM_TYPE(_Ty));
			return query_itf((itf**)out_ptr, &id);
			}

		template<typename _Ty>
		LOLIX_INLINE_CALL	LOLIX_RETNV	query_itf(void* out_ptr)
			{
			const LOLIX_ITF_ID itfid(LOLIX_ITF_FROM_TYPE(_Ty));
			return query_itf((itf**)out_ptr, itfid);
			}

		template<typename _Ty>
		LOLIX_INLINE_CALL	LOLIX_RETNV	query_itf(const _Ty** out_ptr)const
			{
			const LOLIX_ITF_ID itfid(LOLIX_ITF_FROM_TYPE(_Ty));
			return const_cast<this_type*>(this)->query_itf((itf**)out_ptr, &itfid);
			}

		template<typename _Ty>
		LOLIX_INLINE_CALL	LOLIX_RETNV	query_itf(_Ty** out_ptr)
			{
			const LOLIX_ITF_ID itfid(LOLIX_ITF_FROM_TYPE(_Ty));
			return this->query_itf((itf**)out_ptr, &itfid);
			}

		template<typename _Ty>
		LOLIX_INLINE_CALL	LOLIX_RETNV	query_itf(const _Ty** out_ptr)
			{
			const LOLIX_ITF_ID itfid(LOLIX_ITF_FROM_TYPE(_Ty));
			return this->query_itf((itf**)out_ptr, &itfid);
			}
		#pragma	endregion
		#pragma	region	//	增加和减少应用的自动对象
		template<bool not_check_null>
		class	dec_itf
		{
		public:
			LOLIX_INLINE_CALL	void	operator()(itf* i)const
			{
				if ( not_check_null || i )
					i->release();
			}
		};
		template<bool not_check_null>
		class	inc_itf
		{
		public:
			LOLIX_INLINE_CALL	void	operator()(itf* i)const
			{
				if ( not_check_null || i )
					i->inc_ref();
			}
		};
		#pragma endregion
	};


#define		LOLIX_DEFINE_FACTORY(__LX_FC_ID, __LX_FC_PARAM)				\
	class	LOLIX_NO_VTABLE	factory_type	: public ::lolix::itf		\
	{																	\
	public:																\
		LOLIX_DECLARE_ITF(factory_type, itf, __LX_FC_ID);				\
		LOLIX_INTERFACE(create_inst	, LOLIX_RETNV	, __LX_FC_PARAM);	\
	}

#define		LOLIX_DECLARE_PROXY(__LX_PROXY_TYPE, __LX_FC_ID)			\
	class	LOLIX_NO_VTABLE proxy_type		: public ::lolix::itf		\
	{																	\
	public:																\
		typedef	__LX_PROXY_TYPE	proxied_type;							\
		LOLIX_DECLARE_ITF(proxy_type, itf, __LX_FC_ID);					\
		LOLIX_INTERFACE(query		, LOLIX_RETNV	, (const proxied_type** out_ptr)const);\
		LOLIX_INTERFACE(query		, LOLIX_RETNV	, (proxied_type** out_ptr));			\
	}

	////////////////////////////////////////////////////////////////////////////
	//CLASS>>$	:动态内存分配
	////////////////////////////////////////////////////////////////////////////
	//	QUERY_ITF:	loli_clone, loli_copy
	////////////////////////////////////////////////////////////////////////////
	class	LOLIX_NO_VTABLE	dynamic_allocator
		: public lolix::itf
	{
	public:
		LOLIX_DECLARE_ITF(lolix::dynamic_allocator, lolix::itf, (0xc7e1e35e, 0x7c554e09, 0xa0952b58, 0x8ab4ffe9));
		LOLIX_DEFINE_FACTORY((0xc255601e, 0xd4fbf751, 0x996d4dba, 0x907eb9ab), (dynamic_allocator**));
		//--------------------------------------------------------------------------
		//	>> 2007-04-01 17:40:16 >>------------------->> 2007-04-01 17:40:16 >>
			//FUNC>>$	:	分配内存
				//FUNC>>@0	:	[out]	返回的实际内存地址
				//FUNC>>@1	:	[in]	请求的内存的字节数
					//FUNC>>#	:
					//			LOLIX_RETNV_OK			没有问题
					//			LOLIX_ERROR_LESS_MEMORY		内存不足
		//--------------------------------------------------------------------------
		LOLIX_INTERFACE(allocate	, LOLIX_RETNV	, (void**, size_type mem_block_size));

		//--------------------------------------------------------------------------
		//	>> 2007-04-01 17:40:20 >>------------------->> 2007-04-01 17:40:20 >>
			//FUNC>>$	:	释放内存
				//FUNC>>@0	:	[in]	使用该类所得到的内存
				//FUNC>>@1	:	[in]	该内存块的大小 : 必须正确
					//FUNC>>#	:
					//			LOLIX_RETNV_OK			没有问题
		//--------------------------------------------------------------------------
		LOLIX_INTERFACE(deallocate	, LOLIX_RETNV	, (void* mem, size_type mem_block_size));

		//--------------------------------------------------------------------------
		//	>> 2007-04-01 17:40:16 >>------------------->> 2007-04-01 17:40:16 >>
			//FUNC>>$	:	分配内存
				//FUNC>>@0	:	[out]	返回的实际内存地址
				//FUNC>>@1	:	[in]	请求的内存的字节数
				//FUNC>>@2	:	[in]	该内存块的名字, 必须正确
					//FUNC>>#	:
					//			LOLIX_RETNV_OK					没有问题
					//			LOLIX_ERROR_LESS_MEMORY				内存不足
					//			LOLIX_WARNING_UNSUPPORT_INTERFACE		接口不被支持(将返回实际的地址， 如同不带名字的 allocate 接口)
					//				[如果使用的是 LoliX 内部版本， 则有可能该编译版本没有指定 LOLIX_CFG__OPEN_MEM_ALLOC_TRACE ]
					//				@(./lolix/lolix_cfg.h)
		//--------------------------------------------------------------------------
		LOLIX_INTERFACE(allocate	, LOLIX_RETNV	, (void**, size_type mem_block_size, const char* name));

		//--------------------------------------------------------------------------
		//	>> 2007-04-01 17:40:20 >>------------------->> 2007-04-01 17:40:20 >>
			//FUNC>>$	:	释放内存
				//FUNC>>@0	:	[in]	使用该类所得到的内存
				//FUNC>>@1	:	[in]	该内存块的大小 : 必须正确
				//FUNC>>@2	:	[in]	该内存的名字	: 开启名称检测的版本必须指定正确名字
					//FUNC>>#	:
					//			LOLIX_RETNV_OK			没有问题
					//			LOLIX_WARNING_UNSUPPORT_INTERFACE		接口不被支持(将删除实际的地址， 如同没有名字跟踪)
					//				[如果使用的是 LoliX 内部版本， 则有可能该编译版本没有指定 LOLIX_CFG__OPEN_MEM_ALLOC_TRACE ]
					//				@(./lolix/lolix_cfg.h)
		//--------------------------------------------------------------------------
		LOLIX_INTERFACE(deallocate	, LOLIX_RETNV	, (void* mem, size_type mem_block_size, const char* name));
	};


	enum ENUM_THREAD_SAFE
	{
		THREAD_SAFE_SRW		,	//	单线程读写安全				key_bind
		THREAD_SAFE_SRSW	,	//	单线程读-单线程写安全		swap_list
		THREAD_SAFE_SRMW	,	//	单线程读-多线程写安全
		THREAD_SAFE_MRSW	,	//	多线程读-单线程写安全
		THREAD_SAFE_MRW		,	//	多线程读写安全
	};
	class LOLIX_NO_VTABLE ref_counter
		: public lolix::itf
	{
	public:
		LOLIX_DEFINE_FACTORY((0xe10fc028, 0xf411e9c0, 0x99ab909a, 0x3b6a9464), (ref_counter**, ENUM_THREAD_SAFE));
		LOLIX_DECLARE_ITF(ref_counter, lolix::itf, (0x291D7AC2, 0x2B4F405e, 0xB49B31A4, 0x0B013013));
		//--------------------------------------------------------------------------
		//	>> 2007-04-21 17:23:22 >>------------------->> 2007-04-21 17:23:22 >>
			//FUNC>>$	:得到当前引用数
					//FUNC>>#	:当前的引用数
		//--------------------------------------------------------------------------
		LOLIX_INTERFACE(size	, size_type	, (void)const);
	};
	typedef	ref_counter::factory_type	ref_factory;

	////////////////////////////////////////////////////////////////////////////
	//CLASS>>$	:内存数据
	////////////////////////////////////////////////////////////////////////////
	//	QUERY_ITF:	factory_type, loli_clone, loli_copy
	////////////////////////////////////////////////////////////////////////////
#if			defined(LOLIX_DEF__USE_MEMORY)
	class	LOLIX_NO_VTABLE	memory
		: public lolix::itf
	{
	public:
		LOLIX_DEFINE_FACTORY((0xa2e06f36, 0x54d34287, 0xa545243a, 0xc30ca1f8), (memory**));
		LOLIX_DECLARE_ITF(memory, itf, (0x70e6d4a1, 0x76b34f83, 0xa1c369fb, 0x71478985));

		enum { opt_read = 1, opt_write = 2, opt_cut = 4 };

		//--------------------------------------------------------------------------
		//	>> 2007-04-12 23:01:55 >>------------------->> 2007-04-12 23:01:56 >>
			//FUNC>>$	:	清除内存数据(必须在没有 lock 的情况下操作)
				//FUNC>>@	:[null]
					//FUNC>>#	:
					//			LOLIX_RETNV_OK				没有问题
					//			LOLIX_ERROR_INVALID_STATE	状态同步错误
		//--------------------------------------------------------------------------
		virtual	LOLIX_RETNV	LOLIX_CALL	clear(void)							= 0;

		//--------------------------------------------------------------------------
		//	>> 2007-04-13 00:00:25 >>------------------->> 2007-04-13 00:00:25 >>
			//FUNC>>$	:	得到当前内存数据字节数
				//FUNC>>@	:[null]
					//FUNC>>#	:	返回的字节数
		//--------------------------------------------------------------------------
		virtual	size_type	LOLIX_CALL	size(void)const						= 0;

		//--------------------------------------------------------------------------
		//	>> 2007-04-12 23:04:38 >>------------------->> 2007-04-12 23:04:38 >>
			//FUNC>>$	:	设置内存数据内容(内部隐含 clear 操作)
				//FUNC>>@	:	[in]
					//FUNC>>#	:
					//			LOLIX_RETNV_OK					没有问题
					//			LOLIX_ERROR_INVALID_STATE		状态同步错误
					//			LOLIX_ERROR_UNSUPPORT_TYPE		某些特定模块构造的实例不支持任意修改数据
		//--------------------------------------------------------------------------
		//virtual	LOLIX_RETNV	LOLIX_CALL	set_type(const mem_type* const)		= 0;

		//--------------------------------------------------------------------------
		//	>> 2007-04-12 22:54:49 >>------------------->> 2007-04-12 22:54:49 >>
			//FUNC>>$	:	内存类型
				//FUNC>>@	:[out]	对应的内存类型信息
				//FUNC>>#	:
				//			LOLIX_RETNV_OK					没有问题
		//--------------------------------------------------------------------------
		//virtual	LOLIX_RETNV	LOLIX_CALL	get_type(mem_type* const)const		= 0;

		//--------------------------------------------------------------------------
		//	>> 2007-04-12 22:06:26 >>------------------->> 2007-04-12 22:06:26 >>
			//FUNC>>$	:锁定所需要的内存并得到所需求的数据
				//FUNC>>@0	:[out]	返回的内存首地址, 如果请求失败则返回未定义
				//FUNC>>@1	:[in]	操作类型， 读取/写入/插入 等等操作
				//FUNC>>@2	:[in]	从多少个字节开始(如果是写方式, 则只需要 from <= size(), 则表示需要写入 len 长度的数据
				//FUNC>>@3	:[i/o]	in: 需求多少个字节的内存, out: 实际返回了多少个字节
					//FUNC>>#	:
					//			LOLIX_RETNV_OK				没有问题
					//			LOLIX_ERROR_INVALID_PARAM	参数错误
					//			LOLIX_ERROR_OUT_OF_RANGE	"from" 越界
		//--------------------------------------------------------------------------
		virtual	LOLIX_RETNV	LOLIX_CALL	lock(void** const ptr, size_type opt_type, size_type from, size_type* const len)	= 0;

		//--------------------------------------------------------------------------
		//	>> 2007-04-12 22:21:16 >>------------------->> 2007-04-12 22:21:16 >>
			//FUNC>>$	:解除某个范围的锁定
				//FUNC>>@0	:[in]	需要解除的某个起始地址(必须是从 lock 返回的地址, 不能为0)
				//FUNC>>@1	:[in]	需要解除的操作类型
				//FUNC>>@2	:[in]	需要解除的内存长度
					//FUNC>>#	:
					//			LOLIX_RETNV_OK				没有问题
					//			LOLIX_ERROR_INVALID_MEMORY	传入的内存不合法
					//			LOLIX_WARNING_INVALID_STATE	opt_type 状态非法, 但是被纠正了
		//--------------------------------------------------------------------------
		virtual	LOLIX_RETNV	LOLIX_CALL	unlock(void* const ptr, size_type opt_type, size_type len)							= 0;

		//--------------------------------------------------------------------------
		//	>> 2007-05-07 23:43:03 >>------------------->> 2007-05-07 23:43:03 >>
			//FUNC>>$	:得到某个锁定的范围
				//FUNC>>@0	:[in]	所查询某个句柄
				//FUNC>>@1	:[in]	所查询的类型
				//FUNC>>@2	:[out]	长度, 如果请求失败则返回没有定义
					//FUNC>>#	:
					//			LOLIX_RETNV_OK				没有问题
					//			LOLIX_ERROR_INVALID_MEMORY	ptr 非法
					//			LOLIX_ERROR_INVALID_STATE	opt_type 状态非法
		//--------------------------------------------------------------------------
		virtual	LOLIX_RETNV	LOLIX_CALL	locked_size(const void* const ptr, size_type opt_type, size_type* const len)		= 0;
	};
#endif	//	defined(LOLIX_DEF__USE_MEMORY)




	////////////////////////////////////////////////////////////////////////////
	//CLASS>>$	:日志
	////////////////////////////////////////////////////////////////////////////
	//	QUERY_ITF:	factory_type
	////////////////////////////////////////////////////////////////////////////
	class	LOLIX_NO_VTABLE	diary
		: public itf
	{
		typedef	const wchar_t*	_fmt_type;
	public:
		LOLIX_DEFINE_FACTORY((0x77156ba2, 0x3477d4f0, 0x838ca82a, 0xbd9901a5), (diary** out_ptr, wchar_t* title));
		LOLIX_DECLARE_ITF(diary, itf, (0x8e85199f, 0xb4e15acc, 0xebb993eb, 0x6aec8faf));
		LOLIX_INTERFACE(title,	_fmt_type,		(void)const);
		LOLIX_INTERFACE(write,	LOLIX_RETNV,	(_fmt_type* data));
	};

	class	LOLIX_NO_VTABLE	prink
		: public itf
	{
		typedef	LOLIX_ITF_ID*	P_LOLIX_ITF_ID;
		typedef	wchar_t*		_fmt_type;
	public:
		LOLIX_DECLARE_ITF(prink	, itf, (0x3efe877d, 0xa4ac9124, 0xcb176a38, 0x029fd46c));
		LOLIX_INTERFACE(fmt_type, const P_LOLIX_ITF_ID	, (void));

		LOLIX_INTERFACE(clear	, void					, (void));

		LOLIX_INTERFACE(max_size, size_type				, (void)const);
		LOLIX_INTERFACE(max_size, LOLIX_RETNV			, (size_type max_buf));

		LOLIX_INTERFACE(query	, LOLIX_RETNV			, (wchar_t const* val, size_type val_size, void* va_arg_val));
		LOLIX_INTERFACE(c_str	, const _fmt_type		, (void)const);
		LOLIX_INTERFACE(size	, size_type				, (void)const);

#if			defined(va_start)
		LOLIX_INLINE_CALL	LOLIX_RETNV	query_f(wchar_t const* val, size_type val_size, ...)
		{
			va_list ap;
			va_start(ap, val_size);
			LOLIX_RETNV rtv = query(val, val_size, ap);
			va_end(ap);
			return rtv;
		}
#endif	//	!defined(va_start)
	};

#define		LOLIX_DEFINE_ID_INTERFACE(this_type, id)	LOLIX_DEFINE_ID_INTERFACE_FROM_SPECIFIC_TYPE(this_type, ::lolix::itf, id)
#define		__LOLIX_DEFINE_ID_INTERFACE(this_type, id)	LOLIX_DEFINE_ID_INTERFACE(this_type, id)
#define		LOLIX_DEFINE_ID_INTERFACE_FROM_SPECIFIC_TYPE(this_type, base_type, id)	class	LOLIX_NO_VTABLE	this_type: public base_type{ public: LOLIX_DEFINE_ITF_ID id; }
	//	!!	下面两个功能接口的返回值是 顶层基类的意义是可以通过传递这个指针来保存原始的含义
	//	!!	不至于丢失原本类型信息
	//	!!	但是实现接口的时候， 需要保证当使用者直接传递参数后，可以通过强转指针获得正确的类型
	//	clone : 创建一个同类型的对象的初始默认形态， 功能上一致， 同时不保证内部数据一致
	__LOLIX_DEFINE_ID_INTERFACE(loli_clone	,	(0x74fe3809, 0xe92a47d5, 0x910d8115, 0x32060dff));
	//	copy : 创建一个同类型的对象的当前形态， 功能上一致， 同时确保内部数据一致
	__LOLIX_DEFINE_ID_INTERFACE(loli_copy	,	(0xfef3c216, 0x15c54800, 0x8b36bac0, 0x226a01fd));

	//	loli_fmt:
	//	TOKEN = $STR_FMT$
	//	STR_FMT	= USINGED:TYPE	//-	(ADDITION_FLAG)
	//-	ADDITION_FLAG = <{0...9, a...z, A...z}>(ADDITION_FLAG)
	//	TYPE	= (SIGNED)(.USINGED).TYPE_FLAG(USINGED)
	//	TYPE_FLAG = u | d | i | s | c | f | F | m | itf | x | X | o
	//	USIGNED	= (+)	USIGNED_NUM
	//	SIGNED	= (+|-) USIGNED_NUM
	//	USIGNED_NUM	= {0...9} | 0x{0..9, a...f} | 0{0...7}
	//	---------------------------------------------------
	//	ex. "$$" -> "$"
	//		"$1:.u16$"
	//		"$3:0x08.30.itf3$"
	//-		"$0:-13.+64.u+32<color:0xff000000><size:23pt><new_line:center, new_line:right>$"
	__LOLIX_DEFINE_ID_INTERFACE(prink_loli_fmt, (0x061fc620, 0x041396c3, 0x42e03788, 0x37a94cb5));

	class	LOLIX_NO_VTABLE	swap_loli
		: public itf
	{
	public:
		LOLIX_DECLARE_ITF(swap_loli, itf, (0x6db0902a, 0x7042462d, 0x8b0d0216, 0x920bd07b));
		LOLIX_INTERFACE(swap	, LOLIX_RETNV	, (itf* o));
	};

	class	LOLIX_NO_VTABLE	comment_loli
		: public itf
	{
	public:
		LOLIX_DECLARE_ITF(comment_loli, itf, (0xebae80f3, 0x34c35947, 0xc8481329, 0xdc7fa5c2));
		enum	ENUM_COMMENT_TYPE
		{
			COMMENT_TYPE_NAME		,
			COMMENT_TYPE_AUTHOR		,
			COMMENT_TYPE_TIME_STAMP	,	//	fmt:	yyyy-mm-dd hh:mm:ss
			COMMENT_TYPE_COPYRIGHTS	,
			COMMENT_TYPE_DATA		,
			_COMMENT_TYPE_VER	= 0
		};
		LOLIX_INTERFACE(get_var, LOLIX_RETNV, (wchar_t* out_name, size_type* io_buf_size, ENUM_COMMENT_TYPE));
	};


	template<typename _Tthis, typename _Tbase>
	class LOLIX_NO_VTABLE itf_Tbase
		: public _Tbase
	{
	protected:
		typedef itf_Tbase						_Tbase_type;
	public:
		template<typename _Tout>
		static LOLIX_INLINE_CALL	LOLIX_RETNV	__Create_inst_set_alc(_Tout** out_ptr, lolix::dynamic_allocator* alc, lolix::ref_counter::factory_type* ref_fac)
		{
			LOLIX_RETNV rtv;
			ref_counter* ref;
			if ( LOLIX_IS_ERROR(rtv = ref_fac->create_inst(&ref, THREAD_SAFE_MRW)) )
				return rtv;

			typename _Tthis::allocator_type	alc_this(alc);
			_Tthis* ptr = alc_this.allocate(1);
			if ( !ptr )
			{
				ref->release();
				return LOLIX_ERROR_LESS_MEMORY;
			}

			alc_this.construct(ptr);
			ptr->_ref = ref;
			(ptr->_alc = alc)->inc_ref();
			*out_ptr = ptr;
			return LOLIX_RETNV_OK;
		}

		template<typename _Tout>
		static LOLIX_INLINE_CALL	LOLIX_RETNV	__Create_inst(_Tout** out_ptr, lolix::dynamic_allocator* alc, lolix::ref_counter::factory_type* ref_fac)
		{
			LOLIX_RETNV rtv;
			ref_counter* ref;
			if ( LOLIX_IS_ERROR(rtv = ref_fac->create_inst(&ref, THREAD_SAFE_MRW)) )
				return rtv;

			typename _Tthis::allocator_type	alc_this(alc);
			_Tthis* ptr = alc_this.allocate(1);
			if ( !ptr )
			{
				ref->release();
				return LOLIX_ERROR_LESS_MEMORY;
			}

			alc_this.construct(ptr);
			ptr->_ref = ref;
			*out_ptr = ptr;
			return LOLIX_RETNV_OK;
		}

		template<typename _Tout, typename _Tp0>
		static LOLIX_INLINE_CALL	LOLIX_RETNV	__Create_inst(_Tout** out_ptr, lolix::dynamic_allocator* alc, lolix::ref_counter::factory_type* ref_fac, _Tp0 p0)
		{
			LOLIX_RETNV rtv;
			ref_counter* ref;
			if ( LOLIX_IS_ERROR(rtv = ref_fac->create_inst(&ref, THREAD_SAFE_MRW)) )
				return rtv;

			typename _Tthis::allocator_type	alc_this(alc);
			_Tthis* ptr = alc_this.allocate(1);
			if ( !ptr )
			{
				ref->release();
				return LOLIX_ERROR_LESS_MEMORY;
			}

			alc_this.construct(ptr, p0);
			ptr->_ref = ref;
			*out_ptr = ptr;
			return LOLIX_RETNV_OK;
		}

		template<typename _Tout, typename _Tp0>
		static LOLIX_INLINE_CALL	LOLIX_RETNV	__Create_inst_set_alc(_Tout** out_ptr, lolix::dynamic_allocator* alc, lolix::ref_counter::factory_type* ref_fac, _Tp0 p0)
		{
			LOLIX_RETNV rtv;
			ref_counter* ref;
			if ( LOLIX_IS_ERROR(rtv = ref_fac->create_inst(&ref, THREAD_SAFE_MRW)) )
				return rtv;

			typename _Tthis::allocator_type	alc_this(alc);
			_Tthis* ptr = alc_this.allocate(1);
			if ( !ptr )
			{
				ref->release();
				return LOLIX_ERROR_LESS_MEMORY;
			}

			alc_this.construct(ptr, p0);
			ptr->_ref = ref;
			(ptr->_alc = alc)->inc_ref();
			*out_ptr = ptr;
			return LOLIX_RETNV_OK;
		}

		template<typename _Tout, typename _Tp0, typename _Tp1>
		static LOLIX_INLINE_CALL	LOLIX_RETNV	__Create_inst(_Tout** out_ptr, lolix::dynamic_allocator* alc, lolix::ref_counter::factory_type* ref_fac, _Tp0 p0, _Tp1 p1)
		{
			LOLIX_RETNV rtv;
			ref_counter* ref;
			if ( LOLIX_IS_ERROR(rtv = ref_fac->create_inst(&ref, THREAD_SAFE_MRW)) )
				return rtv;

			typename _Tthis::allocator_type	alc_this(alc);
			_Tthis* ptr = alc_this.allocate(1);
			if ( !ptr )
			{
				ref->release();
				return LOLIX_ERROR_LESS_MEMORY;
			}

			alc_this.construct(ptr, p0, p1);
			ptr->_ref = ref;
			*out_ptr = ptr;
			return LOLIX_RETNV_OK;
		}

		template<typename _Tout, typename _Tp0, typename _Tp1>
		static LOLIX_INLINE_CALL	LOLIX_RETNV	__Create_inst_set_alc(_Tout** out_ptr, lolix::dynamic_allocator* alc, lolix::ref_counter::factory_type* ref_fac, _Tp0 p0, _Tp1 p1)
		{
			LOLIX_RETNV rtv;
			ref_counter* ref;
			if ( LOLIX_IS_ERROR(rtv = ref_fac->create_inst(&ref, THREAD_SAFE_MRW)) )
				return rtv;

			typename _Tthis::allocator_type	alc_this(alc);
			_Tthis* ptr = alc_this.allocate(1);
			if ( !ptr )
			{
				ref->release();
				return LOLIX_ERROR_LESS_MEMORY;
			}

			alc_this.construct(ptr, p0, p1);
			ptr->_ref = ref;
			(ptr->_alc = alc)->inc_ref();
			*out_ptr = ptr;
			return LOLIX_RETNV_OK;
		}
	};

	namespace type{
		template<typename type_name>
		class type_value;

		template<>		class type_value<lx_i8>		{public:static const lx_i64	max_val=	0x000000000000007f, min_val=	0x0000000000000080;};
		template<>		class type_value<lx_i16>	{public:static const lx_i64	max_val=	0x0000000000007fff, min_val=	0x0000000000008000;};
		template<>		class type_value<lx_i32>	{public:static const lx_i64	max_val=	0x000000007fffffff, min_val=	0x0000000080000000;};
		template<>		class type_value<lx_i64>	{public:static const lx_i64	max_val=	0x7fffffffffffffff,	min_val=	0x8000000000000000;};

		template<>		class type_value<lx_u8>		{public:static const lx_u64	max_val=	0x00000000000000ff, min_val=	0x0000000000000000;};
		template<>		class type_value<lx_u16>	{public:static const lx_u64	max_val=	0x000000000000ffff, min_val=	0x0000000000000000;};
		template<>		class type_value<lx_u32>	{public:static const lx_u64	max_val=	0x00000000ffffffff, min_val=	0x0000000000000000;};
		template<>		class type_value<lx_u64>	{public:static const lx_u64	max_val=	0xffffffffffffffff,	min_val=	0x0000000000000000;};

		template<typename type>	class	remove_const{ public: typedef	type	value_type; };
		template<typename type>	class	remove_const<const type>{ public: typedef	type	value_type; };
		template<typename>	class	is_signed;
		//template<typename type> class	remove_signed{ public: typedef	typename lolix::toy::type_choise<typename is_signed<type>::value_type, unsigned type, type>::base_type value_type; };

#define		__LOLIX__IS_SIGNED__TMP_PROC(iss, type)				template<>	class	is_signed<type>		{ public: typedef	iss	value_type; }
		__LOLIX__IS_SIGNED__TMP_PROC(type_false, unsigned char);
		__LOLIX__IS_SIGNED__TMP_PROC(type_false, unsigned short);
		__LOLIX__IS_SIGNED__TMP_PROC(type_false, unsigned int);
		__LOLIX__IS_SIGNED__TMP_PROC(type_false, unsigned long);
		__LOLIX__IS_SIGNED__TMP_PROC(type_false, unsigned long long);

		__LOLIX__IS_SIGNED__TMP_PROC(type_true, char);
		__LOLIX__IS_SIGNED__TMP_PROC(type_true, short);
		__LOLIX__IS_SIGNED__TMP_PROC(type_true, int);
		__LOLIX__IS_SIGNED__TMP_PROC(type_true, long);
		__LOLIX__IS_SIGNED__TMP_PROC(type_true, long long);
		__LOLIX__IS_SIGNED__TMP_PROC(type_true, float);
		__LOLIX__IS_SIGNED__TMP_PROC(type_true, double);
		__LOLIX__IS_SIGNED__TMP_PROC(type_true, long double);
#undef		__LOLIX__IS_SIGNED__TMP_PROC
	}
	using type::type_value;
	class init_for_nothing_copy{};
	struct	byte_buffer
	{
		LOLIX_INLINE_CALL	byte_buffer(){}
		LOLIX_INLINE_CALL	byte_buffer(const init_for_nothing_copy){}
		lx_u8	val;
	};
	STATIC_ASSERT(sizeof byte_buffer == 1);


	enum ENUM_VALUE_TYPE
	{	VALUE_TYPE_VOID
	,	VALUE_TYPE_I8
	,	VALUE_TYPE_U8
	,	VALUE_TYPE_I16
	,	VALUE_TYPE_U16
	,	VALUE_TYPE_I32
	,	VALUE_TYPE_U32
	,	VALUE_TYPE_I64
	//	8
	,	VALUE_TYPE_U64
	,	VALUE_TYPE_F16
	,	VALUE_TYPE_F32
	,	VALUE_TYPE_F64
	//	0x0c
	,	_VALUE_TYPE_CNT
	,	_VALUE_TYPE_VER = 0
	};

	LOLIX_INLINE_CALL	size_type	get_value_type_size(ENUM_VALUE_TYPE etype)
	{
		const static size_type size[] =
		{	0
		,	1,	1
		,	2,	2
		,	4,	4
		,	8,	8
		,	2,	4,	8
		};

		return size[etype];

#if			defined(STATIC_ASSERT)
		STATIC_ASSERT(ARRAY_SIZE(size) == _VALUE_TYPE_CNT);
#endif	//	defined(STATIC_ASSERT)
	}

#if			!defined(__LOLIX_PROC_DEFINE__SWAP__)
#define		__LOLIX_PROC_DEFINE__SWAP__
	template<typename _Tl, typename _Tr>
	LOLIX_INLINE_CALL void swap(_Tl& tl, _Tr& tr)
	{
		_Tl tmp(tl);
		tl = tr;
		tr = tmp;
	}
#endif	//	!defined(__LOLIX_PROC_DEFINE__SWAP__)

}

SYS_REGIST_TYPE(lolix::diary);
SYS_REGIST_TYPE(lolix::diary::factory_type);
SYS_REGIST_TYPE(lolix::dynamic_allocator);
SYS_REGIST_TYPE(lolix::dynamic_allocator::factory_type);
SYS_REGIST_TYPE(lolix::init_for_nothing_copy);
SYS_REGIST_TYPE(lolix::itf);
//SYS_REGIST_TYPE(lolix::itf::dec_itf<true>);
//SYS_REGIST_TYPE(lolix::itf::inc_itf<true>);
//SYS_REGIST_TYPE(lolix::itf::dec_itf<false>);
//SYS_REGIST_TYPE(lolix::itf::inc_itf<false>);
SYS_REGIST_TYPE(lolix::loli_clone);
SYS_REGIST_TYPE(lolix::loli_copy);
#if			defined(LOLIX_DEF__USE_MEMORY)
#pragma	warning(push)
#pragma	warning(disable : 4996)
SYS_REGIST_TYPE(lolix::memory);
SYS_REGIST_TYPE(lolix::memory::factory_type);
#pragma	warning(pop)
#endif	//	defined(LOLIX_DEF__USE_MEMORY)
SYS_REGIST_TYPE(lolix::prink);
SYS_REGIST_TYPE(lolix::ref_counter);
SYS_REGIST_TYPE(lolix::ref_counter::factory_type);

//--------------------------------------------------------------------------
//==============================================================================
#endif	//	!defined(__LOLIX__LOLIX_TYPE__K_IN_G__)
